<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>综合网站主页</title>
    <link rel="stylesheet" href="HTML\css\styles1.css">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <ul>
            <li><a href="index.html">首页</a></li>
            <li><a href="login.html">登录</a></li>
            <li><a href="register.html">注册</a></li>
        </ul>
    </nav>

    <!-- 轮播图 -->
    <div class="carousel">
        <div class="slide active">
            <img src="images/slide1.jpg" alt="轮播图1">
        </div>
        <div class="slide">
            <img src="images/slide2.jpg" alt="轮播图2">
        </div>
    </div>

    <!-- 内容区域 -->
    <div class="content">
        <h1>欢迎访问综合网站</h1>
        <p>这是一个使用HTML、CSS和JavaScript构建的示例网站。</p>
    </div>

    <script>
        // 轮播图逻辑
let currentSlide = 0;
const slides = document.querySelectorAll('.slide');

function showSlide(index) {
    slides.forEach((slide) => slide.classList.remove('active'));
    slides[index].classList.add('active');
}

// 自动切换轮播图
setInterval(() => {
    currentSlide = (currentSlide + 1) % slides.length;
    showSlide(currentSlide);
}, 5000);

// 初始化显示第一张轮播图
showSlide(0);
    </script>
</body>
</html>